package com.fourgirls.xiaoxiang.service.Shopping.Impl;


import com.fourgirls.xiaoxiang.dao.ShoppingDao.ShoppingMapper;
import com.fourgirls.xiaoxiang.dao.ShoppingDao.UserShoppingMapper;
import com.fourgirls.xiaoxiang.pojo.Shopping.ShoppingVo;
import com.fourgirls.xiaoxiang.pojo.Shopping.UserNameShoppingVo;
import com.fourgirls.xiaoxiang.pojo.Shopping.UserShoppingVo;
import com.fourgirls.xiaoxiang.service.Shopping.UserShoppingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserShoppingServiceImpl implements UserShoppingService {
    @Autowired
    UserShoppingMapper userShoppingMapper;

    @Autowired
    ShoppingMapper ShoppingMapper;
//---------------------------------------------------------------查询分割线--------------------------------------------------------

    /**
     * 查询medicine表中的所有数据
     *
     * @return 查询的数据
     */
    @Override
    public List<UserShoppingVo> findAllUserShopping(UserNameShoppingVo userNameShoppingVo) {
        return userShoppingMapper.findAllUserShopping(userNameShoppingVo);
    }

    /**
     * 根据user表中的id查询shopping表中的数据
     * @param shoppingVo
     * @return
     */
    @Override
    public int addShopping(ShoppingVo shoppingVo) {
        return ShoppingMapper.addShopping(shoppingVo);
    }
}
